This invention relates to the shading of 3-dimensional computer generated images and to a method and apparatus for performing this.
In our British Patent No. 2281682, there is described a 3-D rendering system for polygons in which each object in a scene to be viewed is defined as a set of surfaces which are infinite. Each elementary area of the screen in which an image is to be displayed has a ray projected through it from a viewpoint into the 3-dimensional scene. The location of the intersection of the projected ray with each surface is then determined. From these intersections it is then possible to determine whether any intersected surface is visible at that elementary area. The elementary area is then shaded for display in dependence on the result of the determination.
The system can be implemented in a pipeline type processor comprising a number of cells, each of which can perform an intersection calculation with a surface. Thus a large number of surface intersections can be computed simultaneously. Each cell is loaded with a set of coefficients defining a surface for which it is to perform the intersection test.
A further improvement which is described in our UK Patent Application No. 2298111 sub-divides the image plane into sub-regions or tiles. This proposes using a variable tile site and projecting a bounding box around complex objects. This is done by firstly determining the distribution of objects around the visible screen for suitable tile sizes to be selected. The surfaces defining the various objects are then stored into one contiguous list. This avoids the need to store identical surfaces for each tile, as one object being made of many surfaces could be in a number of tiles. The tiles can then be rendered in turn using the ray casting technique described above, one at a time rendering all objects within that tile. This is an efficient method because no effort needs to be made to render objects which are known not to be visible in a particular tile.
We have appreciated that the amount of processing can be reduced further if only data pertaining to portions of surfaces which are in fact visible is processed. Thus, in accordance with a preferred embodiment of the invention we provide a method for defining the edges of visible surfaces with planes which are perpendicular to the viewing direction, the image plane of the image.
In accordance with a second aspect of the invention, we have appreciated that, rather than use a variable tile size, the processing may be optimised by using a regular tile size across the whole of the image plane wherein the tile boundaries may intercept with objects but with no edge clipping being necessary. A set of tiles can then be selected which define a bounding box for a particular object and, in order to render that particular object, only the tiles within that particular bounding box needs to be processed. A display list of the surfaces which fall within that tile is used to define objects within the bounding box.
A further improvement on this method discards the tiles within a bounding box which do not actually contain the object to be rendered.